﻿using System.Collections.Generic;
using Metro.Kashikoi.Service.Common.Entity;
using Metro.Kashikoi.ServiceContract.Location;

namespace Metro.Kashikoi.Service.Location.Business
{
    /// <summary>
    /// This interface provides business facade to service layer.
    /// </summary>
    public interface IFacade
    {
        /// <summary>
        /// Creates the organization.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="organization">The organization.</param>
        /// <returns>The newly created organization.</returns>
        void CreateOrganization(IUnitOfWork context, Organization organization);

        /// <summary>
        /// Updates the organization.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="organization">The organization.</param>
        void UpdateOrganization(IUnitOfWork context, Organization organization);

        /// <summary>
        /// Deleles the organization.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="organizationId">The organization id.</param>
        /// <param name="deletedStockArea">The deleted stock area.</param>
        void DeleleOrganization(IUnitOfWork context, int organizationId, IList<int> deletedStockArea);

        /// <summary>
        /// Gets the default organization.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>The default organization.</returns>
        Organization GetDefaultOrganization(IUnitOfWork context);

        /// <summary>
        /// Gets the organization with specific name.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="name">The name.</param>
        /// <returns>The organization with specific name.</returns>
        Organization GetOrganization(IUnitOfWork context, string name);

        /// <summary>
        /// Creates the facility.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="facility">The facility.</param>
        /// <param name="organizationId">The organization id.</param>
        /// <returns>The newly created facility.</returns>
        void CreateFacility(IUnitOfWork context, Facility facility, int organizationId);

        /// <summary>
        /// Updates the facility.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="facility">The facility.</param>
        void UpdateFacility(IUnitOfWork context, Facility facility);

        /// <summary>
        /// Deletes the facility.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="facilityId">The facility id.</param>
        /// <param name="deletedStockArea">The deleted stock area.</param>
        void DeleteFacility(IUnitOfWork context, int facilityId, IList<int> deletedStockArea);

        /// <summary>
        /// Creates the unit.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="unit">The unit.</param>
        /// <param name="facilityId">The facility id.</param>
        /// <returns>The newly created unit.</returns>
        void CreateUnit(IUnitOfWork context, Unit unit, int facilityId);

        /// <summary>
        /// Updates the unit.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="unit">The unit.</param>
        void UpdateUnit(IUnitOfWork context, Unit unit);

        /// <summary>
        /// Deletes the unit.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="unitId">The unit id.</param>
        /// <param name="deletedStockArea">The deleted stock area.</param>
        void DeleteUnit(IUnitOfWork context, int unitId, IList<int> deletedStockArea);

        /// <summary>
        /// Creates the stock area.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="stockArea">The stock area.</param>
        /// <param name="unitId">The unit id.</param>
        /// <returns>The newly created stock area.</returns>
        void CreateStockArea(IUnitOfWork context, StockArea stockArea, int unitId);

        /// <summary>
        /// Updates the stock area.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="stockArea">The stock area.</param>
        void UpdateStockArea(IUnitOfWork context, StockArea stockArea);

        /// <summary>
        /// Deletes the stock area.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="stockAreaId">The stock area id.</param>
        void DeleteStockArea(IUnitOfWork context, int stockAreaId);

        /// <summary>
        /// Gets the stock area.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="stockAreaId">The stock area id.</param>
        /// <returns>The stock area.</returns>
        StockArea GetStockArea(IUnitOfWork context, int stockAreaId);
    }
}
